<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>管理员导航栏</title>
</head>
<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.4.1/css/bootstrap.min.css">
<script src="https://cdn.bootcss.com/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
<body>
{#导航栏#}
<nav class="navbar navbar-inverse">
    <div class="container-fluid">
        <div class="navbar-header">
            <a class="navbar-brand" href="#">导航栏</a>
        </div>
        <ul class="nav navbar-nav">
            <li><a href="{{ url_for('backend') }}">用户管理</a></li>
        </ul>
    </div>
</nav>
</body>
<script>
    {#    获取当前的url，并高亮当前的菜单项#}
    $(function () {
        var url = window.location.href;
        var nav_li = $('.nav li');
        nav_li.removeClass('active');
        for (var i = 0; i < nav_li.length; i++) {
            var href = $(nav_li[i]).find('a').attr('href');
            if (url.indexOf(href) > -1) {
                $(nav_li[i]).addClass('active');
                break;
            }
        }
    });
</script>
</html>